<template>
    <div id="dd">
       <div>
           <table class="table" >
               <tr>
                         <td class="buu">
                            <el-button type="primary" class="but" @click="gj()"> 
                              <i class="el-icon-s-management" ></i>
                                    <div class="dd"> 基本信息</div>
                            </el-button>
                             <!-- <router-link to="/HealtheJiebX">
                             </router-link> -->
                        </td>
                         <td class="buu">
                              <el-button type="primary" class="but" @click="jz()"> 
                              <i class="el-icon-s-custom" ></i>
                                    <div class="dd">家族史</div>
                             </el-button>
                        </td>
               </tr>
               <tr>
                        <td class="buu">
                            <el-button type="primary" class="but" @click="bl()"> 
                             <i class="el-icon-s-management" ></i>
                                    <div class="dd">病例史</div>
                             </el-button>
                        </td>
                        <td class="buu">
                            <el-button type="primary" class="but" @click="gm()"> 
                             <i class="el-icon-s-management" ></i>
                                    <div class="dd">过敏史</div>
                            </el-button>
                        </td>
               </tr>
           </table>
       </div>
    </div>
</template>
<script>
export default {
    created(){
      this.$store.commit("getUsers");
      if(sessionStorage.getItem("user")==null||sessionStorage.getItem("pwd")==null){
            this.$router.push("/logg")
      }
  },
  methods:{
      gj(){
        this.$router.push("/HealtheJiebX")
      },
      jz(){
        this.$router.push("/HealtheJiaz")
      }, 
      bl(){
        this.$router.push("/HealtheBili")
      }, 
      gm(){
        this.$router.push("/HealtheGuomi")
      },

  },
  created(){
        this.$store.commit("getUsers");
            if(sessionStorage.getItem("user")==null||sessionStorage.getItem("pwd")==null){
            this.$router.push("/logg")
        }
         this.axios.post('abb/ch',{username:sessionStorage.getItem("user"),pwd:sessionStorage.getItem("pwd")}).then(response=>{
            sessionStorage.setItem("tid",response.data.tid);
            sessionStorage.setItem("id",response.data.id);
            sessionStorage.setItem("birthday",response.data.birthday);
            sessionStorage.setItem("email",response.data.email);
            sessionStorage.setItem("fullname",response.data.fullname);
            sessionStorage.setItem("gender",response.data.gender);
            sessionStorage.setItem("password",response.data.password);
            sessionStorage.setItem("telephone",response.data.telephone);
            sessionStorage.setItem("username",response.data.username);
            this.$store.commit("getTusers")
              this.axios.post('abb/shi',{tid:response.data.tid}).then(response=>{
              console.log(response.data);
              sessionStorage.setItem("familyhistory",response.data.familyhistory)
              sessionStorage.setItem("medicalhistory",response.data.medicalhistory)
              sessionStorage.setItem("allergichistory",response.data.allergichistory)
              this.$store.commit("getTusers")
            })
         })
         
    }
}
</script>
<style scoped>
    .table{
        width: 100%;
        height: 800px;
    }
    .buu{
        font-size: 50px;
        width: 50%;
        border: 1px black solid;
        background-color: skyblue;
        border-radius: 2%;
    }
     a{
    text-decoration:none;
  }
  .dd{
      color:black;
      font-size:50px;
  }
  .but{
      width: 100%;
      height: 100%;
  }
</style>